Mega Code Archive

Categories
1) Android
2) ASP.Net
3) ASP.Net Tutorial
4) C
5) C Tutorial
6) C#
7) C# Book
8) C# by API
9) C# Tutorial
10) C++
11) C++ Tutorial
12) Delphi
13) Flash ActionScript
14) Flex
15) Java
16) Java Book
17) Java by API
18) Java Tutorial
19) JavaScript DHTML
20) JavaScript Reference
21) JavaScript Tutorial
22) MSOfficeExcel 2007 Tutorial
23) MSOfficePowerPoint 2007 Tutorial
24) MSOfficeWord 2007 Tutorial
25) MSSQL
26) MSSQL Tutorial
27) MySQL
28) MySQL Tutorial
29) Oracle PLSQL
30) Oracle PLSQL Tutorial
31) Perl
32) Php
33) PostgreSQL
34) Python
35) Python Tutorial
36) Ruby
37) Silverlight
38) VB.Net
39) VB.Net by API
40) VB.Net Tutorial
41) Visual C++ .NET
42) VisualBasic Script
43) XML
44) XML Tutorial
 
Python Tutorial
1) Buildin Function
2) Buildin Module
3) CGI Web
4) Class
5) Collections
6) Data Type
7) Database
8) Dictionary
9) File
10) Function
11) Introduction
12) List
13) Network
14) Operator
15) Regular Expressions
16) Statement
17) String
18) Thread
19) Tkinker
20) Tuple
21) Windows
22) Wxpython
23) XML
String
1) %[(name)][flags][width][ precision]code
2) A basic conversion specifier
3) A blank ( ) means that a blank should be put in front of positive numbers
4) A minus sign (-) left-aligns the value
5) A plus (+) means that a sign should precede both positive and negative numbers
6) Add backslash to the end of raw string
7) An optional second argument can be supplied to translate, specifying letters that should be deleted
8) Case In-Sensitive Compare
9) Case Sensitive Compare
10) Center a string
11) Cmp() function performs a lexicographic (ASCII value-based) comparison for strings
12) Compare string demo
13) Concatenating Strings
14) Conditional Execution and the if Statement
15) Convert a list of characters back to a string
16) Convert all names to lowercase both when storing and searching
17) Creating strings and using quote characters in strings
18) Dictionary-Based String Formatting
19) Display a string with triple quotes
20) Effects of Setting the Default Encoding
21) Encode(iso-8859-1)
22) Encode(utf-16)
23) Encode(utf-8)
24) Find from an index
25) Find from right
26) Find the index of a substring
27) For any ranges [start
28) For statement Used with Sequence Types
29) For strings, it is easy to iterate over each character
30) Format Operator Auxiliary Directives
31) Formatted String
32) Get the final index of our string is
33) Get the length of an input string
34) Access Values (Characters and Substrings) in Strings
35) Remove Characters and Strings
36) Update Strings
37) ID Check
38) If the replacement field is part of a word, the name must be enclosed in braces
39) In
40) In is case sensitive
41) In order to insert a dollar sign, use $$
42) Index from right
43) Index with offset
44) Interpolating Variables Inside Strings
45) Introducing ljust
46) Introducing StringIO
47) Joining a list of words
48) Joining Strings
49) Left justify
50) Measure some strings
51) Membership (in, not in)
52) Normal to Unicode
53) Print paired with the string format operator ( % )
54) Range() with len() for indexing into a string
55) Raw string
56) Raw Strings dont treat the backslash as a special character
57) Replacing a substring
58) Repr creates a string that is a representation of the value as a legal Python expression
59) Right justify
60) Rindex with index
61) Runtime String Concatenation
62) Search and Replace in Strings
63) Searching from end of string
64) Searching strings for a substring
65) Searching Strings for Specific EndingsBeginnings
66) Searching Strings for Substrings
67) Signs, Alignment, and Zero-Padding
68) Single-Quoted Strings and Escaping Quotes
69) Slice a string
70) Specify which characters are to be stripped, by listing them all in a string parameter
71) Split by
72) Split is the inverse of join, and is used to split a string into a sequence
73) Split lines
74) Split Without Arguments
75) Splitting Strings
76) Storing Non-ASCII Characters
77) Str converts a value into a string
78) String format
79) String formatting
80) String Formatting Conversion Types
81) String formatting is done with the string formatting operator, the percent (%) sign
82) String Formatting vs Concatenating
83) String literals and other sequence literals may be indexed directly, without using a variable to refer to them
84) String variable
85) String-formatting codes
86) Strings are compared according to their order when sorted alphabetically
87) Strip leading and trailing characters
88) Strip tabs
89) Strip trailing spaces
90) Stripping whitespace from a string
91) Take a string and display it in a loop
92) Template strings
93) Template systems (in this case using HTML)
94) The %e, %f, and %g formats display floating-point numbers in different ways, as the following interaction demonstrates
95) The find method finds a substring within a larger string
96) The lower method returns a lowercase version of the string
97) The replace method returns a string where all the occurrences of one string have been replaced by another
98) The strip method returns a string where whitespace on the left and right (but not internally) has been stripped (removed)
99) The syntax for using the format operator is as follows
100) To check whether a value can be found in a sequence, you use the in operator
101) To clear or remove a string, you assign an empty string or use the del statement, respectively
102) To ignore the difference between uppercase and lowercase letters, use the string methods upper or lower
103) To write a string that spans several lines, you can use triple quotes instead of ordinary quotes
104) Token splitting and delimiter joining
105) Translate replaces parts of a string, translate only works with single characters
106) Triple Quotes
107) Unicode Strings
108) Unicode to normal
109) Use the string format operator ( % ), or put all of the substrings in a list, and using one join() call to put them all together.tx
110) Useful Values from the string Module
111) Using None as an index has the same effect as a missing index
112) When either a starting or an ending index is missing, they default to the beginning or end of the string, respectively
113) Width and Precision
114) You can supply the value-name pairs in a dictionary